//
//  KJTableViewManager.h
//  KJKit
//
//  Created by Tiger on 2022/6/9.
//

#import <Foundation/Foundation.h>
#import "KJTableViewSection.h"
#import "KJTableViewCell.h"

NS_ASSUME_NONNULL_BEGIN

@interface KJTableViewManager : NSObject <UITableViewDelegate, UITableViewDataSource>

@property (weak, readwrite, nonatomic) UITableView *tableView;
@property (nonatomic, strong) UIView *tableHeaderView;
@property (nonatomic, strong) UIView *tableFooterView;

@property (nonatomic, strong) NSMutableArray<KJTableViewSection *> *sections;

@property (nonatomic, weak) id <UIScrollViewDelegate> scrollDelegate;

- (instancetype)initWithTableView:(UITableView *)tableView;

- (void)addSection:(KJTableViewSection *)section;
- (void)addSectionsFromArray:(NSArray<KJTableViewSection *> *)array;
- (void)removeSection:(KJTableViewSection *)section;
- (void)removeAllSections;

- (void)deselectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;
- (void)reloadSectionAtIndex:(NSInteger)section withRowAnimation:(UITableViewRowAnimation)animation;

@end

NS_ASSUME_NONNULL_END
